<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>完善个人信息</title>
<script language="javascript" src="<?=public_js_path();?>jquery.js">
</script>
<script language="javascript">
$(document).ready(function() {
	
	$("#submit_button").click( function () {
		var sex = $("#sex").val();
		var birthday = $("#birthday").val();
		var hobby = $("#hobby").val();
		var true_name = $("#true_name").val();
		if( sex!="" && birthday!="" && hobby!="" && true_name!="" ){
			complete(sex,birthday,hobby,true_name);
			return false;
		}else{
			return false;
		}
	});
});
function complete(sex,birthday,hobby,true_name){
	$("#complete_info").html("<img src='<?=public_img_path();?>ajaxloading.gif' border=0 />已发送请求,请等待!");
	$.ajax({
		type: "POST",
		url: "<?=site_url(array('user','complete'));?>",
		data: "sex="+sex+"&birthday="+birthday+"&hobby="+hobby+"&true_name="+true_name,
		success: function(str){
			str = jQuery.parseJSON(str);
			if( str.status==1 ){
				alert(str.info);
				$("#is_complete").html('');
				$("#complete_info").html('');
				return false;
			}else{
				alert(str.info);
				$("#complete_info").html('');
				return false;
			}
		}
	});
}
</script>
</head>
<body>
    <div>
    	<span style="color:#FF0000" id="is_complete"><?php if(($is_complete&1)==0){ echo '完善信息将获得10积分！';}?></span>
        用户名:<?php echo $this->session->userdata('username');?>
        <form id="my_form" name="my_form" method="post" action="<?=site_url(array('user','complete'));?>">
          <ul class="service">
              <li class="posclear">
                  <div class="registw1 posfloatl">性别</div><select name="sex" id="sex"><option value="1">男</option><option value="2">女</option></select>*
              </li>
              <li class="posclear">
                  <div class="registw1 posfloatl">生日</div><select name="birthday" id="birthday"><option value="1">男</option><option value="2">女</option></select>*
              </li>
              <li class="posclear">
                  <div class="registw1 posfloatl">兴趣</div><textarea name="hobby" id="hobby"></textarea>*
              </li>
              <li class="posclear">
                  <div class="registw1 posfloatl">真实姓名</div><input name="true_name" id="true_name" />*
              </li>
              <li><input id="submit_button" type="button" value="提交" />&nbsp;&nbsp;&nbsp;<span id="complete_info" style="color:#FF0000"></span></li>
          </ul>
      </form>
    </div>
</body>
</html>
